package com.xiaochen.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

//@Controller是控制器注释
@Controller
public class Hello {
    //@RequestMapping定义访问路径 
    //这里定义的路径是/test，使用get访问
    @RequestMapping(path="/test",method = RequestMethod.GET)
    public String test(ModelMap model){
        model.addAttribute("message","你好啊，小陈!~");
        //返回到test视图
        return "test";
    }
}
